extern long f(long, long*);
#include <stdio.h>
int test () {
	int errors=0;
	long data = 1;
	long i,expected=1;
	for (i=0; i<24; i++) {
		long result=f(i,&data);
		if (result!=expected) {
			errors++;
			printf("Error: Iteration %d expected %ld but got %ld\n",i,expected,result);
		}
		if (result!=data) {
			errors++;
			printf("Error: Iteration %d expected data %ld but got %ld\n",i,expected,data);
		}
		expected*=2;
	} 
	if (errors==0) {
		return 1;
	} else {
		return 0;
	}
}

RET(test()==1);
